home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 60.zip / BS1 part 60 / Crossdos v5.7.adf / Install < prev    next >
Text File  |  1993-06-07  |  35KB  |  1,577 lines

  1. ;********************************************************************
  2. ;Installation script for CrossDOS 5+ (including CrossPC)
  3. ;********************************************************************
  4.  
  5. ;$VER: Install 5.06 (7.6.93)
  6.  
  7. ;Bugs in Installer V1.22:
  8.  
  9. ;1. The "run" command does not accept a relative path.
  10. ;2. The tooltype delete feature is case-sensitive.
  11.  
  12. ;mycopylib is used because of installer limitations. It uses the following global
  13. ;strings as input:
  14. ;mysource - source
  15. ;mydest - destination
  16. ;mynewname - new name
  17.  
  18. (procedure mycopylib
  19.     (
  20.         (set errorflag 0)
  21.         ;form destination file
  22.         (set destfile
  23.             (tackon mydest mynewname)
  24.         )
  25.         (if
  26.             (= 0
  27.                 (exists destfile)
  28.             )
  29.             (
  30.                 (copyfiles
  31.                     (source mysource)
  32.                     (dest mydest)
  33.                     (newname mynewname)
  34.                 )
  35.                 (set errorflag 1)
  36.             )
  37.             (
  38.                 ;the destfile exists, so we must check the versions
  39.                 (if
  40.                     (exists mysource)
  41.                     (
  42.                         (set sourcevernum (getversion mysource))
  43.                         (set sourcever (/ sourcevernum 65536))
  44.                         (set sourcerev (- sourcevernum (* sourcever 65536)))
  45.                         (set destvernum (getversion destfile))
  46.                         (set destver (/ destvernum 65536))
  47.                         (set destrev (- destvernum (* destver 65536)))
  48.                         (if
  49.                             (or
  50.                                 (or
  51.                                     (not ks20)
  52.                                     (> sourcever destver)
  53.                                 )
  54.  
  55.                                 (
  56.                                     (and
  57.                                         (= sourcever destver)
  58.                                         (>= sourcerev destrev)
  59.                                     )
  60.                                 )
  61.                             )
  62.                             (
  63.                                 (copyfiles
  64.                                     (source mysource)
  65.                                     (dest mydest)
  66.                                     (newname mynewname)
  67.                                 )
  68.                                 (set errorflag 1)
  69.                             )
  70.                         )
  71.                     )
  72.                 )
  73.             )
  74.         )
  75.         (if
  76.             (= errorflag 0)
  77.             (
  78.                 ;Handle a version conflict
  79.                 (if
  80.                     (= @user-level 2)
  81.                     (
  82.                         (if
  83.                             (askbool
  84.                                 (prompt (cat "The version of \"" mynewname)
  85.                                          "\" currently on your system appears to be "
  86.                                          "newer than the CrossDOS version. Select \"Skip\" to "
  87.                                          "preserve the version currently on your system, "
  88.                                          "or \"Overwrite\" to install the CrossDOS version "
  89.                                          "regardless."
  90.                                 )
  91.                                 (choices "Overwrite"
  92.                                          "Skip"
  93.                                 )
  94.                                 (help "This message should only appear if you are "
  95.                                       "running Workbench 2.1 or later. If you are not, "
  96.                                       "select Overwrite to copy the CrossDOS file anyway."
  97.                                 )                            
  98.                             )
  99.                             (
  100.                                 (copyfiles
  101.                                     (source mysource)
  102.                                     (dest mydest)
  103.                                     (newname mynewname)
  104.                                 )
  105.                                 (set errorflag 1)
  106.                             )
  107.                         )
  108.                     )
  109.                 )
  110.             )
  111.         )
  112.     )
  113. )
  114.  
  115.  
  116. (procedure InstallTDPatch
  117.     (
  118.         ;Install TDPatch12/TDPatch13
  119.  
  120.         (if
  121.             (< ksver 35)
  122.             (
  123.                 (if
  124.                     (= ksver 33)
  125.                     (
  126.                         (set patch "TDPatch12 >nil:")
  127.                         (copyfiles
  128.                             (source ":c/TDPatch12")
  129.                             (dest "c:")
  130.                         )
  131.                     )
  132.                     (
  133.                         (set patch "TDPatch13 >nil:")
  134.                         (copyfiles
  135.                             (source ":c/TDPatch13")
  136.                             (dest "c:")
  137.                         )
  138.                     )
  139.                 )
  140.                 (if
  141.                     (= @user-level 2)
  142.                     (message "You are running Kickstart 1.2 or 1.3. "
  143.                              "A special patch utility called TDPatch12/"
  144.                              "TDPatch13 is REQUIRED for CrossDOS/CrossPC to function "
  145.                              "on your system. This file was copied to "
  146.                              "your C: directory."
  147.                     )
  148.                 )
  149.             )
  150.         )
  151.     )
  152. )
  153.  
  154.  
  155. ;SetHD -- place hard drive information (e.g. C=PCC) in the CrossPC tooltypes
  156. ;harddisk -- e.g. PCC
  157. ;pcdir -- directory of CrossPC icon
  158.  
  159. (procedure SetHD
  160.     (
  161.         ;If the user has configured a hard drive during this session,
  162.         ;add an appropriate tooltype.
  163.  
  164.         (if
  165.             (not
  166.                 (= harddisk "")
  167.             )
  168.             (
  169.                 ;Grab the last character of harddisk and place it in hdchar
  170.                 (set hdchar
  171.                     (substr harddisk
  172.                         (-
  173.                             (strlen harddisk)
  174.                             1
  175.                         )
  176.                         1
  177.                     )
  178.                 )
  179.  
  180.                 (if
  181.                     (not
  182.                         (exists
  183.                             (tackon pcdir "CrossPC.info")
  184.                         )
  185.                     )
  186.                     (message "Warning: Can't find CrossPC's icon. CrossPC will not be configured.")
  187.                 )
  188.  
  189.                 (tooltype
  190.                     (dest (tackon pcdir "CrossPC"))
  191.                     (settooltype hdchar harddisk)
  192.                 )
  193.             )
  194.         )
  195.     )
  196. )
  197.  
  198.  
  199. ;MountHD -- mount the thing
  200. ;harddisk -- e.g. PCC
  201.  
  202. (procedure MountHD
  203.     (
  204.         ;If the user has configured a hard drive during this session,
  205.         ;mount etc.
  206.  
  207.         (if
  208.             (not
  209.                 (= harddisk "")
  210.             )
  211.             (
  212.                 ;Mount the hard drive the user just configured.
  213.  
  214.                 (run
  215.                     (cat @execute-dir
  216.                         (cat "c/mount >nil: devs:DOSDrivers/" harddisk)
  217.                     )
  218.                 )
  219.             )
  220.         )
  221.     )
  222. )
  223.  
  224. ;********************** CrossDOS UNinstallation **************************
  225.  
  226. ;Enter with "deletedirstr" set to the name of the directory to terminate
  227. ;and deletepat with the amigados wildcards.
  228. (procedure deletedir
  229.     (
  230.         (if
  231.             (= 2
  232.                 (exists deletedirstr)
  233.             )
  234.             (
  235.                 (foreach deletedirstr deletepat
  236.                     (delete
  237.                         (tackon deletedirstr @each-name)
  238.                     )
  239.                 )
  240.                 (delete
  241.                     (tackon deletedirstr ".info")
  242.                 )
  243.                 (delete deletedirstr)
  244.                 (delete
  245.                     (cat deletedirstr ".info")
  246.                 )
  247.             )
  248.         )
  249.     )
  250. )
  251.  
  252. (procedure DeleteOldCD
  253.     (
  254. ;misc
  255.         (delete "sys:wbstartup/mountmf")
  256.         (delete "sys:wbstartup/mountmf.info")
  257.  
  258. ;sys:system
  259.         (delete "sys:system/diskchg")
  260.         (delete "sys:system/diskchk")
  261.         (delete "sys:system/IntlTrans")
  262.         (delete "sys:system/kill")
  263.         (delete "sys:system/mdiskcopy")
  264.         (delete    "sys:system/mformat")
  265.         (delete "sys:system/txfilter")
  266.  
  267.         (delete "sys:system/diskchg.info")
  268.         (delete "sys:system/diskchk.info")
  269.         (delete "sys:system/IntlTrans.info")
  270.         (delete "sys:system/kill.info")
  271.         (delete "sys:system/mdiskcopy.info")
  272.         (delete    "sys:system/mformat.info")
  273.         (delete "sys:system/txfilter.info")
  274.  
  275.         (delete "sys:system/Atari_S9.MFormat.info")
  276.         (delete "sys:system/Atari_D9.MFormat.info")
  277.         (delete "sys:system/MSDOS_D9.MFormat.info")
  278.         (delete "sys:system/MSDOS_S9.MFormat.info")
  279.         (delete "sys:system/MSDOS_QD9.MFormat.info")
  280.         (delete "sys:system/MSDOS_Q18.MFormat.info")
  281.  
  282.         (delete "sys:system/DiskChg.di0.info")
  283.         (delete "sys:system/DiskChg.di1.info")
  284.         (delete "sys:system/DiskChg.di2.info")
  285.         (delete "sys:system/DiskChg.di3.info")
  286.  
  287.         (delete "sys:system/Kill.di0.info")
  288.         (delete "sys:system/Kill.di1.info")
  289.         (delete "sys:system/Kill.di2.info")
  290.         (delete "sys:system/Kill.di3.info")
  291.  
  292.         (delete "sys:system/TxFilter.di0.info")
  293.         (delete "sys:system/TxFilter.di1.info")
  294.         (delete "sys:system/TxFilter.di2.info")
  295.         (delete "sys:system/TxFilter.di3.info")
  296.  
  297. ;sys:crossdos
  298.         (delete "sys:crossdos/diskchg")
  299.         (delete "sys:crossdos/diskchk")
  300.         (delete "sys:crossdos/IntlTrans")
  301.         (delete "sys:crossdos/kill")
  302.         (delete "sys:crossdos/mdiskcopy")
  303.         (delete    "sys:crossdos/mformat")
  304.         (delete "sys:crossdos/txfilter")
  305.  
  306.         (delete "sys:crossdos/diskchg.info")
  307.         (delete "sys:crossdos/diskchk.info")
  308.         (delete "sys:crossdos/IntlTrans.info")
  309.         (delete "sys:crossdos/kill.info")
  310.         (delete "sys:crossdos/mdiskcopy.info")
  311.         (delete    "sys:crossdos/mformat.info")
  312.         (delete "sys:crossdos/txfilter.info")
  313.  
  314.         (delete "sys:crossdos/Atari_S9.MFormat.info")
  315.         (delete "sys:crossdos/Atari_D9.MFormat.info")
  316.         (delete "sys:crossdos/MSDOS_D9.MFormat.info")
  317.         (delete "sys:crossdos/MSDOS_S9.MFormat.info")
  318.         (delete "sys:crossdos/MSDOS_QD9.MFormat.info")
  319.         (delete "sys:crossdos/MSDOS_Q18.MFormat.info")
  320.  
  321.         (delete "sys:crossdos/DiskChg.di0.info")
  322.         (delete "sys:crossdos/DiskChg.di1.info")
  323.         (delete "sys:crossdos/DiskChg.di2.info")
  324.         (delete "sys:crossdos/DiskChg.di3.info")
  325.  
  326.         (delete "sys:crossdos/Kill.di0.info")
  327.         (delete "sys:crossdos/Kill.di1.info")
  328.         (delete "sys:crossdos/Kill.di2.info")
  329.         (delete "sys:crossdos/Kill.di3.info")
  330.  
  331.         (delete "sys:crossdos/TxFilter.di0.info")
  332.         (delete "sys:crossdos/TxFilter.di1.info")
  333.         (delete "sys:crossdos/TxFilter.di2.info")
  334.         (delete "sys:crossdos/TxFilter.di3.info")
  335.  
  336.         (delete "sys:crossdos/.info")
  337.         (delete "sys:crossdos")
  338.  
  339.         (if
  340.             (not
  341.                 (exists "sys:crossdos")
  342.             )
  343.             (delete "sys:crossdos.info")
  344.         )
  345.     )
  346. )
  347.  
  348.  
  349. (procedure UnInstallCrossDOS
  350.     (
  351.         (if
  352.             (askbool
  353.                 (prompt "About to UNinstall CrossDOS: This function will try to "
  354.                         "remove CrossDOS completely from your system. CrossPC will not "
  355.                         "be removed, but it will cease to function properly. If you wish to "
  356.                         "remove CrossPC, simply delete the \"CrossPC\" file from Workbench "
  357.                         "or the CLI at any time.\n\n"
  358.                         "Are you sure you want to uninstall CrossDOS?"
  359.                 )
  360.                 (help "This function will try to remove CrossDOS from your system "
  361.                       "to the extent that it is possible to do so safely. Some parts "
  362.                       "of CrossDOS \(such as replacement Mount, Format, and Diskcopy "
  363.                       "commands\) will not be removed, because doing so might "
  364.                       "disrupt the normal functioning of the system. Only in very "
  365.                       "extreme cases should you find it neccessary to revert to the "
  366.                       "to the original \(Commodore-supplied\) commands."
  367.                 )
  368.             )
  369.             (
  370.                 (DeleteOldCD)
  371.                 (delete "l:MSDOSFileSystem")
  372.                 (delete "l:CrossDOSFileSystem")
  373.                 (delete "devs:mfm.device")
  374.                 (delete "c:TDPatch12")
  375.                 (delete "c:TDPatch13")
  376.                 (delete "sys:system/CDFormat")
  377.                 (delete "sys:system/CDFormat.info")
  378.                 (delete "sys:system/CDDiskcopy")
  379.                 (delete "sys:system/CDDiskcopy.info")
  380.                 (delete "sys:system/CrossDOS")
  381.                 (delete "sys:system/CrossDOS.info")
  382.                 (delete "sys:system/DiskChg")
  383.                 (delete "sys:system/DiskChg.info")
  384.                 (delete "devs:dosdrivers/pc0")
  385.                 (delete "devs:dosdrivers/pc1")
  386.                 (delete "devs:dosdrivers/pc2")
  387.                 (delete "devs:dosdrivers/pc3")
  388.                 (delete "devs:dosdrivers/pc0.info")
  389.                 (delete "devs:dosdrivers/pc1.info")
  390.                 (delete "devs:dosdrivers/pc2.info")
  391.                 (delete "devs:dosdrivers/pc3.info")
  392.                 (set deletedirstr "sys:system/alt_formats")
  393.                 (set deletepat "#?")
  394.                 (deletedir)
  395.                 (set deletedirstr "l:FileSystem_Trans")
  396.                 (set deletepat "#?.crossdos")
  397.                 (deletedir)
  398.  
  399.                 ;Comment-out the main mount command from the user-startup
  400.  
  401.                 (if
  402.                     (exists "s:user-startup")
  403.                     (
  404.                         (startup "CrossDOSV5+ - automatically mount all devices"
  405.                             (help "This procedure only affects the main mount command placed "
  406.                                   "in the user-startup by the CrossDOS installation. After uninstallation, "
  407.                                   "the command will still be present in exactly the same form, "
  408.                                   "but it will be preceded by a \";\" character, thereby nullifying its "
  409.                                   "effects."
  410.                             )
  411.                             (prompt
  412.                                 (cat "This step will disable the CrossDOS "
  413.                                     (cat prefix
  414.                                         "Mount commmand in the "
  415.                                         "user-startup that normally mounts all devices in the "
  416.                                         "devs:DOSDrivers directory. (Other mount statements are unaffected). "
  417.                                         "If you wish to preserve this "
  418.                                         "functionality, you may choose to skip this part."
  419.                                     )
  420.                                 )
  421.                             )
  422.                             (command (cat ";" (cat prefix "Mount >nil: devs:DOSDrivers/~(#?.info)")))
  423.                         )
  424.                     )
  425.                 )
  426.                 (message "Finished UnInstalling CrossDOS. If you have manually moved "
  427.                          "parts of CrossDOS from their normal location, those files "
  428.                          "are still on your disk."
  429.                 )
  430.             )
  431.         )
  432.     )
  433. )
  434.  
  435. ;********************** CrossDOS installation **************************
  436.  
  437. (procedure ModifyStartup
  438.     (
  439.         (startup "CrossDOSV5+ - automatically mount all devices"
  440.             (prompt "About to install a command in s:user-startup to automatically "
  441.                     "start CrossDOS when you boot your system..."
  442.             )
  443.             (help "Normally you want CrossDOS to be automatically invoked every "
  444.                   "time you start your system."
  445.             )
  446.             (command (cat prefix "Mount >nil: devs:DOSDrivers/~(#?.info)"))
  447.         )
  448.     )
  449. )
  450.  
  451. (procedure InstallCrossDOS
  452.     (
  453.         (message "About to install CrossDOS...")
  454.  
  455.         ;Delete an old installation of CrossDOS
  456.  
  457.         (if
  458.             (exists "l:msdosfilesystem")
  459.             (set old 1)    ;if old
  460.             (set old 0)    ;if not old
  461.         )
  462.         (if old
  463.             (
  464.                 (message "About to delete a previous CrossDOS installation...")
  465.                 (DeleteOldCD)
  466.             )
  467.         )
  468.  
  469.         ;Replace old MountMF command
  470.         (if
  471.             (exists "sys:mountmf")
  472.             (copyfiles
  473.                 (source ":c/MountMF")
  474.                 (dest "sys:")
  475.             )
  476.         )
  477.         (if
  478.             (exists "sys:crossdos/mountmf")
  479.             (copyfiles
  480.                 (source ":c/MountMF")
  481.                 (dest "sys:CrossDOS")
  482.             )
  483.         )
  484.         (if
  485.             (exists "c:mountmf")
  486.             (copyfiles
  487.                 (source ":c/MountMF")
  488.                 (dest "c:")
  489.             )
  490.         )
  491.  
  492.         ;Replace CDMount
  493.         (if
  494.             (exists "c:CDMount")
  495.             (copyfiles
  496.                 (source (cat ":c/Mount" postfix))
  497.                 (dest "c:")
  498.                 (newname "CDMount")
  499.             )
  500.         )
  501.  
  502.         ;Create certain directories if they don't exist
  503.         (makedir "l:FileSystem_Trans"
  504.             (infos)
  505.         )
  506.         (makedir "sys:system"
  507.             (infos)
  508.         )
  509.  
  510.         ;The purpose of this is to create an icon for the devs: directory
  511.         ;if needed.
  512.         (makedir
  513.             (getassign "devs")
  514.             (infos)
  515.         )
  516.         (makedir "devs:DOSDrivers"
  517.             (infos)
  518.         )
  519.  
  520.         (if ks20
  521.             (
  522.                 (set postfix ".2")
  523.                 ;Try to delete some 1.3 crust
  524.                 (delete "c:TDPatch12")
  525.                 (delete "c:TDPatch13")
  526.             )
  527.             (set postfix "")
  528.         )
  529.  
  530.         ;Put up menu asking about diskcopy/format/mount
  531.  
  532.         (set utilopt 0)
  533.         (if @user-level
  534.             (set utilopt
  535.                 (askchoice
  536.                     (prompt "CrossDOS is supplied with greatly enhanced DiskCopy, Format "
  537.                             "and Mount commands. We recommend replacing the existing commands "
  538.                             "to allow greater functionality. "
  539.                             "Please select an "
  540.                             "option:"
  541.                     )
  542.                     (choices "Replace existing commands"
  543.                              "Rename to CDDiskCopy, CDFormat, CDMount"
  544.                     )
  545.                     (help "Most users will want to replace their old commands with "
  546.                           "the enhanced commands, because the old commands offer "
  547.                           "no advantage. If you are fond of the old commands you may "
  548.                           "choose to install the commands with a different name, starting with "
  549.                           "CD (Cross Dos). Note that the replace option will NOT "
  550.                           "overwrite your commands if you have a newer version "
  551.                           "than we supply."
  552.                     )
  553.                 )
  554.             )
  555.         )
  556.         (if
  557.             (= utilopt 0)
  558.             (
  559.                 (set prefix "")
  560.                 ;Try to delete CDDiskcopy and CDFormat
  561.                 (delete "sys:system/CDFormat")
  562.                 (delete "sys:system/CDFormat.info")
  563.                 (delete "sys:system/CDDiskcopy")
  564.                 (delete "sys:system/CDDiskcopy.info")
  565.             )
  566.         )
  567.         (if
  568.             (= utilopt 1)
  569.             (set prefix "CD")
  570.         )
  571.  
  572.         (InstallTDPatch)
  573.  
  574.         ;Install mfm.device
  575.  
  576.         (copyfiles
  577.             (source ":devs/mfm.device")
  578.             (dest "devs:")
  579.         )
  580.  
  581.         ;Install Mount command
  582.  
  583.         (set mysource (cat ":c/Mount" postfix))
  584.         (set mydest "c:")
  585.         (set mynewname (cat prefix "Mount"))
  586.         (mycopylib)
  587.  
  588.         ;Install CrossDOSFileSystem
  589.  
  590.         (copyfiles
  591.             (source (cat ":l/CrossDOSFileSystem" postfix))
  592.             (dest "l:")
  593.             (newname "CrossDOSFileSystem")
  594.         )
  595.         (if old
  596.             (copyfiles
  597.                 (source (cat ":l/CrossDOSFileSystem" postfix))
  598.                 (dest "l:")
  599.                 (newname "MSDOSFileSystem")
  600.             )
  601.         )
  602.  
  603.         ;Copy devs:dosdrivers
  604.         (foreach ":" "PC?"
  605.             (
  606.                 (copyfiles
  607.                     (source
  608.                         (cat ":" @each-name)
  609.                     )
  610.                     (dest "devs:DOSDrivers")
  611.                 )
  612.                 (copyfiles
  613.                     (source
  614.                         (cat ":"
  615.                             (cat @each-name ".info")
  616.                         )
  617.                     )
  618.                     (dest "devs:DOSDrivers")
  619.                 )
  620.                 (tooltype
  621.                     (dest
  622.                         (cat "devs:DOSDrivers/" @each-name)
  623.                     )
  624.                     (noposition)
  625.                     (setdefaulttool
  626.                         (cat
  627.                             (cat "c:" prefix)
  628.                             ("Mount")
  629.                         )
  630.                     )
  631.                     ;Delete the "filesystem=" entry
  632.                     ;Case-sensitive!!! (yet another installer bug)
  633.                     (settooltype "FILESYSTEM")
  634.                 )
  635.             )
  636.         )
  637.  
  638.         ;Install gadtools13.library if running under 1.3.
  639.  
  640.         (if
  641.             (not ks20)
  642.             (
  643.                 (copyfiles
  644.                     (source ":libs/gadtools13.library")
  645.                     (dest "libs:")
  646.                 )
  647.             )
  648.         )
  649.  
  650.         ;Ask the user whether he has a floptical
  651.  
  652.         (set floptical
  653.             (askbool
  654.                 (prompt "Do you have a Floptical drive?")
  655.                 (help "If you aren't sure whether you have a Floptical, "
  656.                       "you don't have one."
  657.                 )
  658.             )
  659.         )
  660.  
  661.         ;Install Format
  662.  
  663.         (if floptical
  664.             (
  665.                 (copyfiles
  666.                     (source ":system/Format")
  667.                     (dest "sys:system")
  668.                     (newname (cat prefix "Format"))
  669.                 )
  670.             )
  671.             (
  672.                 (set mysource (cat ":system/Format" postfix))
  673.                 (set mydest "sys:system")
  674.                 (set mynewname (cat prefix "Format"))
  675.                 (mycopylib)
  676.             )
  677.         )
  678.  
  679.         (if errorflag
  680.             (
  681.                 (copyfiles
  682.                     (source ":system/Format.info")
  683.                     (dest "sys:system")
  684.                     (newname (cat prefix "Format.info"))
  685.                 )
  686.                 (tooltype
  687.                     (dest "sys:system/Format")
  688.                     (noposition)
  689.                 )
  690.             )
  691.         )
  692.  
  693.         ;Install alternate format icons (if floptical user)
  694.  
  695.         (set deletedirstr "sys:system/alt_formats")
  696.         (set deletepat "#?")
  697.         (deletedir)
  698.  
  699.         (if floptical
  700.             (
  701.                 (makedir "sys:system/Alt_Formats"
  702.                     (infos)
  703.                 )
  704.  
  705.                 (foreach ":system/Alt_Formats" "#?.Format.info"
  706.                     (
  707.                         (copyfiles
  708.                             (source
  709.                                 (cat ":system/Alt_Formats/" @each-name)
  710.                             )
  711.                             (dest "sys:system/Alt_Formats")
  712.                         )
  713.  
  714.                         ;Create a version of @each-name without the .info
  715.                         (set infoname
  716.                             (substr @each-name 0
  717.                                 (-
  718.                                     (strlen @each-name)
  719.                                     5
  720.                                 )
  721.                             )
  722.                         )
  723.  
  724.                         (tooltype
  725.                             (dest
  726.                                 (cat "sys:system/Alt_Formats/" infoname)
  727.                             )
  728.                             (noposition)
  729.                             (setdefaulttool
  730.                                 (cat
  731.                                     (cat "sys:system/" prefix)
  732.                                     ("Format")
  733.                                 )
  734.                             )
  735.                         )
  736.                     )
  737.                 )
  738.             )
  739.         )
  740.  
  741.         ;Install DiskCopy
  742.  
  743.         (set mysource (cat ":system/DiskCopy" postfix))
  744.         (set mydest "sys:system")
  745.         (set mynewname (cat prefix "DiskCopy"))    
  746.         (mycopylib)
  747.         (if errorflag
  748.             (
  749.                 (copyfiles
  750.                     (source ":system/DiskCopy.info")
  751.                     (dest "sys:system")
  752.                     (newname (cat prefix "DiskCopy.info"))
  753.                 )
  754.                 (tooltype
  755.                     (dest "sys:system/DiskCopy")
  756.                     (noposition)
  757.                 )
  758.             )
  759.         )
  760.  
  761.         ;Install the CrossDOS utility
  762.  
  763.         (copyfiles
  764.             (source (cat ":system/CrossDOS" postfix))
  765.             (dest "sys:system")
  766.             (newname "CrossDOS")
  767.         )
  768.         (copyfiles
  769.             (source ":system/CrossDOS.info")
  770.             (dest "sys:system")
  771.         )
  772.         (tooltype
  773.             (dest "sys:system/CrossDOS")
  774.             (noposition)
  775.         )
  776.  
  777.         ;Copy FileSystem_Trans
  778.         (copyfiles
  779.             (source ":l/FileSystem_Trans")
  780.             (dest "l:FileSystem_Trans")
  781.             (all)
  782.         )
  783.  
  784.         ;Last copy operation -- copy DiskChg to sys:system
  785.  
  786.         (copyfiles
  787.             (source ":system/DiskChg")
  788.             (dest "sys:system")
  789.             (infos)    ;required!!!
  790.         )
  791.         (tooltype
  792.             (dest "sys:system/DiskChg")
  793.             (noposition)
  794.         )
  795.  
  796.         ;Enter mount command in s:user-startup. Previously we did this whenever
  797.         ;installing on a new CD user's system. Now we don't care whether he has
  798.         ;an old CD, but we do avoid inserting it into the u-s if the user is
  799.         ;running Workbench 2.1 or higher, unless we are in expert mode and
  800.         ;the user overrides our wisdom.
  801.  
  802.         (if
  803.             (and
  804.                 (= @user-level 2)
  805.                 wb21
  806.             )
  807.             (
  808.                 (if
  809.                     (askbool
  810.                         (prompt "If you select \"Install\", a command will be "
  811.                                 "inserted into your s:user-startup file to mount "
  812.                                 "all devices in the DOSDrivers drawer. Since you are "
  813.                                 "running Workbench 2.1 or above, however, this command should "
  814.                                 "already be there, unless you have extensively customized your "
  815.                                 "system. Select \"Skip\" to avoid adding a "
  816.                                 "redundant command \(which won't hurt, but will slow down "
  817.                                 "booting\)."
  818.                         )
  819.                         (choices "Install" "Skip")
  820.                         (help "In most cases you should select \"Skip\".")
  821.                     )
  822.                     (
  823.                         (user 0)
  824.                         (ModifyStartup)
  825.                         (user 2)
  826.                     )
  827.                 )
  828.             )
  829.             (
  830.                 (if
  831.                     (not wb21)
  832.                     (ModifyStartup)
  833.                 )
  834.             )
  835.         )
  836.  
  837.         ;Mount the stuff now so the user can use it immediately
  838.  
  839.         ;This 'run' is safe because c: is an explicit path
  840.         (run
  841.             (cat
  842.                 (cat "c:" prefix)
  843.                 ("Mount >nil: devs:DOSDrivers/~(#?.info)")
  844.             )
  845.         )
  846.  
  847.         (message "CrossDOS is now installed.")
  848.     )
  849. )
  850.  
  851. ;********************** CrossPC installation **************************
  852.  
  853. (procedure InstallCrossPC
  854.     (
  855.  
  856.         (if
  857.             (not
  858.                 (exists ":CrossPC")
  859.             )
  860.             (
  861.                 (message "This copy of CrossDOS does not include CrossPC. Exiting...")
  862.                 (exit
  863.                     (quiet)
  864.                 )
  865.             )
  866.         )
  867.  
  868.         (message "About to install CrossPC...")
  869.  
  870.         (if
  871.             (= 0
  872.                 (exists "l:CrossDOSFileSystem")
  873.             )
  874.             (
  875.                 (message "Note: CrossDOS V5 is not currently installed. It is "
  876.                          "STRONGLY suggested that you install CrossDOS before "
  877.                          "attempting to use CrossPC - or, if you prefer, invoke "
  878.                          "CrossDOS directly from the product disk."
  879.                 )
  880.                 (InstallTDPatch)
  881.                 (copyfiles
  882.                     (source ":devs/mfm.device")
  883.                     (dest "devs:")
  884.                 )
  885.             )
  886.         )
  887.  
  888.         (set pcdir
  889.             (askdir
  890.                 (prompt "Please select a drawer in which to install "
  891.                         "CrossPC"
  892.                 )
  893.                 (help "CrossPC is not picky about where you put it. Choose "
  894.                       "any drive/drawer. Use the \"Make New Drawer\" option "
  895.                       "to create a new drawer, if desired."
  896.                 )
  897.                 (default "sys:")
  898.             )
  899.         )
  900.         (copyfiles
  901.             (source ":CrossPC")
  902.             (dest pcdir)
  903.         )
  904.  
  905.         ;Copy the CrossPC.info file from the product disk UNLESS one already
  906.         ;exists in the destination directory.
  907.  
  908.         (if
  909.             (not
  910.                 (exists
  911.                     (tackon pcdir "CrossPC.info")
  912.                 )
  913.             )
  914.             (
  915.                 (copyfiles
  916.                     (source ":CrossPC.info")
  917.                     (dest pcdir)
  918.                 )
  919.                 (tooltype
  920.                     (dest
  921.                         (tackon pcdir "CrossPC")
  922.                     )
  923.                     (noposition)
  924.                 )
  925.             )
  926.         )
  927.  
  928.         ;Set memory size tooltype for CrossPC
  929.  
  930.         (set memopt
  931.             (askchoice
  932.                 (prompt "Select a default IBM memory size. (You may change it later "
  933.                         "by using the Info facility of Workbench)."
  934.                 )
  935.                 (help "If you have a reasonable amount of Amiga memory (3MB+) we "
  936.                       "recommend the 704K setting to maximize the ability "
  937.                       "of CrossPC. (NOTE: CrossPC does NOT support expanded or extended "
  938.                       "memory). However, if maximum compatibility is your primary "
  939.                       "concern, choose the 640K setting; a few (very few!) programs "
  940.                       "don't run with 704K of memory."
  941.                 )
  942.                 (choices "256K - recommended for 1MB systems"
  943.                          "384K"
  944.                          "512K"
  945.                          "640K - most compatible setting"
  946.                          "704K - recommended for 3MB+ systems"
  947.                 )
  948.             )
  949.         )
  950.         (if
  951.             (= memopt 0)
  952.             (set memtool "256")
  953.         )
  954.         (if
  955.             (= memopt 1)
  956.             (set memtool "384")
  957.         )
  958.         (if
  959.             (= memopt 2)
  960.             (set memtool "512")
  961.         )
  962.         (if
  963.             (= memopt 3)
  964.             (set memtool "640")
  965.         )
  966.         (if
  967.             (= memopt 4)
  968.             (set memtool "704")
  969.         )
  970.  
  971.         (tooltype
  972.             (dest (tackon pcdir "CrossPC"))
  973.             (settooltype "MEM1" memtool)
  974.         )
  975.  
  976.         ;Check whether the user has a DF1:. If so, place B=PC1 in the
  977.         ;CrossPC tooltypes.
  978.  
  979.         (if
  980.             (not
  981.                 (= ""
  982.                     (getassign "df1" "d")
  983.                 )
  984.             )
  985.             (
  986.                 (tooltype
  987.                     (dest (tackon pcdir "CrossPC"))
  988.                     (settooltype "B" "PC1")
  989.                 )
  990.             )
  991.         )
  992.  
  993.         ;Check whether the user has a DF2: but no DF1:. In that case,
  994.         ;modify the "b=" tooltype.
  995.  
  996.         (if
  997.             (= ""
  998.                 (getassign "df1" "d")
  999.             )
  1000.             (
  1001.                 (if
  1002.                     (not
  1003.                         (= ""
  1004.                             (getassign "df2" "d")
  1005.                         )
  1006.                     )
  1007.                     (
  1008.                         (tooltype
  1009.                             (dest (tackon pcdir "CrossPC"))
  1010.                             (settooltype "B" "PC2")
  1011.                         )
  1012.                     )
  1013.                 )
  1014.             )
  1015.         )
  1016.         (message "CrossPC is now installed.")
  1017.     )
  1018. )
  1019.  
  1020. ;********************** Configure Hard Disk **************************
  1021.  
  1022. (procedure ConfigureHardDisk
  1023.     (
  1024.         (if
  1025.             (= 0
  1026.                 (exists "l:CrossDOSFileSystem")
  1027.             )
  1028.             (
  1029.                 (message "CrossDOS 5 is not currently installed. It must "
  1030.                          "be installed before you can configure a hard drive. "
  1031.                          "Switching to CrossDOS installation..."
  1032.                 )
  1033.                 (InstallCrossDOS)
  1034.             )
  1035.         )
  1036.  
  1037.         (set opt
  1038.             (askchoice
  1039.                 (choices "Configure on an Amiga Partition"
  1040.                          "Configure a 100% MS-DOS Hard Disk"
  1041.                 )
  1042.                 (prompt "Please select an option. * Hit HELP for details!!! *")
  1043.                 (help "If you wish to create a simulated MS-DOS hard drive "
  1044.                       "on one of your Amiga hard drive partitions (note: "
  1045.                       "the MS-DOS information will completely wipe out any Amiga "
  1046.                       "files on that partition) select \"Configure on an Amiga "
  1047.                       "Partition\". If you want to dedicate an entire PHYSICAL "
  1048.                       "hard drive (or Syquest or Floptical or...) to storing "
  1049.                       "MS-DOS information, select \"Configure a 100% MS-DOS Hard "
  1050.                       "Disk\"."
  1051.                 )
  1052.             )
  1053.         )
  1054.  
  1055.         ;Ask for drive prefix
  1056.  
  1057.         (set driveprefix
  1058.             (askstring
  1059.                 (default "PC")
  1060.                 (prompt "Please enter a prefix to be assigned to the MS-DOS "
  1061.                         "device you wish to configure.  A 'C' will be added "
  1062.                         "to the end of the device name for you.  Please choose "
  1063.                         "a device name that is not already in use.  "
  1064.                         "\nPress HELP for details."
  1065.                 )
  1066.                 (help "You must enter a prefix (which may be any normal "
  1067.                       "text, without spaces or any special characters) which will "
  1068.                       "be used to access the MS-DOS drive/partition from AmigaDOS.  "
  1069.                       "A letter of 'C' will be "
  1070.                       "added by the configuration utility "
  1071.                       "to form the complete drive name, as accessed from AmigaDOS. "
  1072.                       "The relationship between the AmigaDOS drive name and the "
  1073.                       "MS-DOS drive name (accessed by CrossPC or by a real IBM) is very "
  1074.                       "simple. The last letter of the AmigaDOS name is the MS-DOS name. "
  1075.                       "For example, PCC: refers to MS-DOS drive C:. The prefix to "
  1076.                       "enter now would be PC (the default)."
  1077.                 )
  1078.             )
  1079.         )
  1080.  
  1081.         ;Create a temporary directory
  1082.  
  1083.         (makedir "ram:CrossDOSTemp")
  1084.  
  1085.         (set MountListDir "ram:CrossDOSTemp")
  1086.         (makedir MountListDir)
  1087.  
  1088.         ;Run the ConfigDev program
  1089.  
  1090.         (if
  1091.             (= opt 0)
  1092.             (set drivetype "AMIGA")
  1093.             (set drivetype "MSDOS")
  1094.         )
  1095.         (set runargs
  1096.             (cat
  1097.                 (drivetype)
  1098.                 (" -fL:CrossDOSFileSystem")
  1099.             )
  1100.         )
  1101.         (set runargs
  1102.             (cat
  1103.                 (runargs)
  1104.                 (cat
  1105.                     (" -t")
  1106.                     (MountListDir)
  1107.                 )
  1108.             )
  1109.         )
  1110.         (set runargs
  1111.             (cat
  1112.                 (runargs)
  1113.                 (cat
  1114.                     (" -p")
  1115.                     (driveprefix)
  1116.                 )
  1117.             )
  1118.         )
  1119.         (run
  1120.             (cat
  1121.                 (cat @execute-dir "c/ConfigDisk ")
  1122.                 runargs
  1123.             )
  1124.         )
  1125.  
  1126.         ;The purpose of this is to create an icon for the devs: directory
  1127.         ;if needed.
  1128.         (makedir
  1129.             (getassign "devs")
  1130.             (infos)
  1131.         )
  1132.         (makedir "devs:DOSDrivers"
  1133.             (infos)
  1134.         )
  1135.  
  1136.         ;Create icons for the files in MountListDir and copy to DEVS:DOSDrivers
  1137.         (set success 0)
  1138.         (foreach MountListDir "#?"
  1139.             (
  1140.                 (set success 1)
  1141.                 (set okflag 1)
  1142.  
  1143.                 ;Check for "floptical" - ignore
  1144.  
  1145.                 (if
  1146.                     (= @each-name "floptical")
  1147.                     (set okflag 0)
  1148.                 )
  1149.  
  1150.                 ;Check whether the user already has a mountfile of the same name
  1151.                 (if okflag
  1152.                     (if
  1153.                         (exists
  1154.                             (cat
  1155.                                 ("devs:DOSDrivers/")
  1156.                                 (@each-name)
  1157.                             )
  1158.                         )
  1159.                         (
  1160.                             (set okflag
  1161.                                 (askbool
  1162.                                     (prompt "A file called \"" @each-name
  1163.                                             "\" already exists in your DEVS:DOSDrivers "
  1164.                                             "directory."
  1165.                                     )
  1166.                                     (choices "Overwrite"
  1167.                                              "Cancel"
  1168.                                     )
  1169.                                     (help "You may elect to overwrite the mountfile "
  1170.                                           "that currently exists, or abort the whole "
  1171.                                           "procedure."
  1172.                                     )
  1173.                                 )
  1174.                             )
  1175.                         )
  1176.                     )
  1177.                 )
  1178.  
  1179.                 (if okflag
  1180.                     (
  1181.                         (copyfiles
  1182.                             (source
  1183.                                 (cat
  1184.                                     (cat
  1185.                                         (MountListDir)
  1186.                                         ("/")
  1187.                                     )
  1188.                                     (@each-name)
  1189.                                 )
  1190.                             )
  1191.                             (dest "devs:DOSDrivers")
  1192.                             (infos)    ;just in case the DOSDrivers directory needs to be created.
  1193.                         )
  1194.                         (copyfiles
  1195.                             (source ":PC0.info")
  1196.                             (dest "devs:DOSDrivers")
  1197.                             (newname (cat @each-name ".info"))
  1198.                         )
  1199.  
  1200.                         (tooltype
  1201.                             (dest
  1202.                                 (cat
  1203.                                     ("devs:DOSDrivers/")
  1204.                                     (@each-name)
  1205.                                 )
  1206.                             )
  1207.                             (noposition)
  1208.                             (setdefaulttool
  1209.                                 (cat
  1210.                                     (cat "c:" prefix)
  1211.                                     ("Mount")
  1212.                                 )
  1213.                             )
  1214.                             ;Delete the "filesystem=" entry
  1215.                             ;Case-sensitive!!! (yet another installer bug)
  1216.                             (settooltype "FILESYSTEM")
  1217.                         )
  1218.                         (set harddisk @each-name)
  1219.                     )
  1220.                 )
  1221.             )
  1222.         )
  1223.  
  1224.         ;Delete the file created by ConfigDisk
  1225.         (if success
  1226.             (
  1227.                 (delete "ram:CrossDOSTemp/floptical")
  1228.                 (delete
  1229.                     (cat
  1230.                         ("ram:CrossDOSTemp/")
  1231.                         (harddisk)
  1232.                     )
  1233.                 )
  1234.  
  1235.                 ;Check whether the user selected "Install CrossPC". If not,
  1236.                 ;ask whether he wants to add this drive to CrossPC's tooltypes etc.
  1237.  
  1238.                 (if
  1239.                     (in mainopt 1)
  1240.                     (
  1241.                         (MountHD)
  1242.                         (SetHD)
  1243.                     )
  1244.                     (
  1245.                         (MountHD)
  1246.                         (if
  1247.                             (or
  1248.                                 (= 1
  1249.                                     (exists "sys:CrossPC")
  1250.                                 )
  1251.                                 (= 1
  1252.                                     (exists "sys:CrossPC/CrossPC")
  1253.                                 )
  1254.                             )
  1255.                             (
  1256.                                 (if
  1257.                                     ;File?
  1258.                                     (= 1
  1259.                                         (exists "sys:CrossPC")
  1260.                                     )
  1261.                                     (
  1262.                                         (set pcdir "sys:")
  1263.                                         (SetHD)
  1264.                                     )
  1265.                                     (
  1266.                                         (set pcdir "sys:CrossPC")
  1267.                                         (SetHD)
  1268.                                     )
  1269.                                 )
  1270.                             )
  1271.                             (
  1272.                                 ;Ask the user whether he wants to set the CrossPC tooltype
  1273.                                 (if
  1274.                                     (askbool
  1275.                                         (prompt "If you have already installed CrossPC *and* "
  1276.                                                 "you wish to make the hard drive you configured "
  1277.                                                 "accessible to CrossPC, select \"Yes\"."
  1278.                                         )
  1279.                                         (help "If you select \"yes\", the installer will ask you "
  1280.                                               "where CrossPC has been installed. The installer "
  1281.                                               "will proceed to add a tooltype to the CrossPC icon."
  1282.                                         )
  1283.                                     )
  1284.                                     (
  1285.                                         (set notok 1)
  1286.                                         (while notok
  1287.                                             (
  1288.                                                 (set pcdir
  1289.                                                     (askdir
  1290.                                                         (prompt "Select the directory in which you "
  1291.                                                                 "installed CrossPC."
  1292.                                                         )
  1293.                                                         (help "The installer will proceed to add a tooltype "
  1294.                                                               "to the CrossPC icon."
  1295.                                                         )
  1296.                                                         (default "sys:")
  1297.                                                     )
  1298.                                                 )
  1299.                                                 (if
  1300.                                                     (= 1
  1301.                                                         (exists
  1302.                                                             (tackon pcdir "CrossPC")
  1303.                                                         )
  1304.                                                     )
  1305.                                                     (
  1306.                                                         (SetHD)
  1307.                                                         (set notok 0)
  1308.                                                     )
  1309.                                                     (
  1310.                                                         (message "CrossPC is not in the directory you selected.")
  1311.                                                     )
  1312.                                                 )
  1313.                                             )
  1314.                                         )
  1315.                                     )
  1316.                                 )
  1317.                             )
  1318.                         )
  1319.                     )
  1320.                 )
  1321.  
  1322.                 (if success
  1323.                     (message "Hard drive configuration is completed."
  1324.                         "\n\n############  WARNING!!!  ############"
  1325.                         "\nDO NOT use our Format command or the Amiga format command "
  1326.                         "to format " harddisk ":.  Instead, you must treat the "
  1327.                         "hard disk you just configured as an unpartitioned, unformatted "
  1328.                         " MS-DOS hard disk.  "
  1329.                         "This means you must use the FDISK and FORMAT commands "
  1330.                         "provided by MS-DOS to partition and format the hard disk.  "
  1331.                         "(Consult your MS-DOS manual about the use of these commands.)  "
  1332.                         "Failure to heed this warning may cause unpredictable results."
  1333.                     )
  1334.                     (message "Hard drive configuration could not be completed.")
  1335.                 )
  1336.             )
  1337.         )
  1338.  
  1339.         ;Delete the temporary directory created by this script
  1340.         (delete "ram:CrossDOSTemp")
  1341.     )
  1342. )
  1343.  
  1344. ;********************** Product Registration **************************
  1345.  
  1346. (procedure Register
  1347.     (
  1348.         (run
  1349.             (cat @execute-dir
  1350.                 (cat "c/Registration "
  1351.                     (cat @execute-dir "RegistrationInfo")
  1352.                 )
  1353.             )
  1354.         )
  1355.     )
  1356. )
  1357.  
  1358. ;***************************************************************************
  1359. ;***************************** MAIN ****************************************
  1360. ;***************************************************************************
  1361.  
  1362.  
  1363. ;Force user level to 1 or 2. This is unfortuntely required because otherwise
  1364. ;we can't present a menu of choices to the user.
  1365. (if
  1366.     (= @user-level 0)
  1367.     (
  1368.         (user 1)
  1369.         (set @user-level 0)
  1370.     )
  1371. )
  1372.  
  1373. ;Disallow pretend mode
  1374. (if @pretend
  1375.     (
  1376.         (message "Sorry, you can't run the installation in "
  1377.                  "\"pretend\" mode. Exiting..."
  1378.         )
  1379.         (exit
  1380.             (quiet)
  1381.         )
  1382.     )
  1383. )
  1384.  
  1385. ;Test whether we can access :l/CrossDOSFileSystem. If not, the user is
  1386. ;not running from the product disk - abort.
  1387.  
  1388. (if
  1389.     (not
  1390.         (exists ":l/CrossDOSFileSystem")
  1391.     )
  1392.     (
  1393.         (message "You must run the installation program from the "
  1394.                  "CrossDOS disk. Exiting..."
  1395.         )
  1396.         (exit
  1397.             (quiet)
  1398.         )
  1399.     )
  1400. )
  1401.  
  1402. ;Initialize certain variables
  1403. (set pcdir "")
  1404. (set harddisk "")
  1405.  
  1406. (set disklabel
  1407.     (expandpath ":")
  1408. )
  1409. (set @execute-dir disklabel)
  1410.  
  1411. ;get Kickstart version number
  1412. (set ksver
  1413.     (/
  1414.         (getversion "exec.library"
  1415.             (resident)
  1416.         )
  1417.         65536
  1418.     )
  1419. )
  1420.  
  1421. ;set ks20 variable to 1 if running Kickstart 2.04 or above
  1422. (set ks20
  1423.     (> ksver 36)
  1424. )
  1425.  
  1426. ;get Workbench version number
  1427. (set wbver
  1428.     (/
  1429.         (getversion "version.library"
  1430.             (resident)
  1431.         )
  1432.         65536
  1433.     )
  1434. )
  1435.  
  1436. ;set wb21 variable to 1 if running Workbench 2.1 or above
  1437. (set wb21
  1438.     (> wbver 37)
  1439. )
  1440.  
  1441.  
  1442. ;Check to see whether the user has a c:CDMount. If so, set "prefix"
  1443. ;to "CD".
  1444.  
  1445. (if
  1446.     (exists "c:CDMount")
  1447.     (set prefix "CD")
  1448. )
  1449.  
  1450. ;Check whether the disk label is "CrossDOS_Plus:"; if not, try to relabel the
  1451. ;disk.
  1452. ;The rename (relabel in this case) command doesn't seem to work...another
  1453. ;installer bug?
  1454.  
  1455. ;(if
  1456. ;    (not
  1457. ;        (= disklabel "CrossDOS_Plus:")
  1458. ;    )
  1459. ;    (
  1460. ;        (rename
  1461. ;            (disklabel)
  1462. ;            ("CrossDOS_Plus")
  1463. ;            (disk)
  1464. ;        )
  1465. ;    )
  1466. ;)
  1467.  
  1468.  
  1469. (while 1
  1470.     (
  1471.         ;Attempt to determine what the default menu options should be
  1472.         (set defmenu 0)
  1473.         (if
  1474.             (not
  1475.                 (exists "l:CrossDOSFileSystem")
  1476.             )
  1477.             (set defmenu
  1478.                 (bitor defmenu 9)
  1479.             )
  1480.         )
  1481.         (if
  1482.             (and
  1483.                 (not
  1484.                     (exists "sys:CrossPC")
  1485.                 )
  1486.                 (exists ":CrossPC")
  1487.             )
  1488.             (set defmenu
  1489.                 (bitor defmenu 10)
  1490.             )
  1491.         )
  1492.  
  1493.         ;Ask the user what he wants to install or do.
  1494.  
  1495.         (set mainopt
  1496.             (askoptions
  1497.                 (prompt "Please select all functions that you wish to perform")
  1498.                 (choices "Install CrossDOS"
  1499.                          "Install CrossPC"
  1500.                          "Configure MS-DOS Hard Disk for CrossDOS & CrossPC"
  1501.                          "Fill out Product Registration"
  1502.                          "Uninstall CrossDOS"
  1503.                 )
  1504.                 (default defmenu)
  1505.                 (help "The \"Install CrossDOS\" and \"Install CrossPC\" options install the "
  1506.                       "software. The \"Configure MS-DOS Hard Disk\" option will run ConfigDisk, "
  1507.                       "which allows you to set up a drive or partition for CrossPC and "
  1508.                       "CrossDOS. The \"Fill out Product Registration\" option will "
  1509.                       "prompt you for your name and address, and print it to PRT: (the "
  1510.                       "default printer). Using the registration software eliminates "
  1511.                       "the difficulties we sometimes have reading hand-written registration cards. "
  1512.                       "Use the \"Uninstall CrossDOS\" option to remove CrossDOS."
  1513.                 )
  1514.             )
  1515.         )
  1516.  
  1517.         (if
  1518.             (= mainopt 0)
  1519.             (
  1520.                 (message "You didn\'t select anything. Exiting...")
  1521.                 (exit
  1522.                     (quiet)
  1523.                 )
  1524.             )
  1525.         )
  1526.  
  1527.         (if
  1528.             (or
  1529.                 (not
  1530.                     (in mainopt 4)
  1531.                 )
  1532.                 (= mainopt 16)
  1533.             )
  1534.             (
  1535.                 (if
  1536.                     (in mainopt 0)
  1537.                     (
  1538.                         (InstallCrossDOS)
  1539.  
  1540.                         ;Check to see whether the user has a c:CDMount. If so, set "prefix"
  1541.                         ;to "CD".
  1542.                         (if
  1543.                             (exists "c:CDMount")
  1544.                             (set prefix "CD")
  1545.                         )
  1546.                     )
  1547.                 )
  1548.                 (if
  1549.                     (in mainopt 1)
  1550.                     (InstallCrossPC)
  1551.                 )
  1552.                 (if
  1553.                     (in mainopt 2)
  1554.                     (ConfigureHardDisk)
  1555.                 )
  1556.                 (if
  1557.                     (in mainopt 3)
  1558.                     (Register)
  1559.                 )
  1560.                 (if
  1561.                     (in mainopt 4)
  1562.                     (UninstallCrossDOS)
  1563.                 )
  1564.                 (exit
  1565.                     (quiet)
  1566.                 )
  1567.             )
  1568.             (
  1569.                 (message "The uninstall option cannot be selected in conjunction "
  1570.                          "with any other options. Perhaps you accidentally "
  1571.                          "selected it."
  1572.                 )
  1573.             )
  1574.         )
  1575.     )
  1576. )
  1577.